/**
 *@author Sun Feiyue(Asfya)
*/
package com.ass.view;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;

public class Alerts {

	public static void showPromptDialog(String message, Context ctx){
		//Create a builder
		AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
		builder.setTitle("Alert");
		//add buttons and listener
		builder.setPositiveButton("OK", null);
		//set message
		builder.setMessage(message);
		//Create the dialog
		AlertDialog ad = builder.create();
		//show
		ad.show();
	}
	
	public static void showPromptDialog(String title, String message, Context ctx){
		//Create a builder
		AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
		builder.setTitle(title);
		//add buttons and listener
		builder.setPositiveButton("OK", null);
		//set message
		builder.setMessage(message);
		//Create the dialog
		AlertDialog ad = builder.create();
		//show
		ad.show();
	}
	
	public static void showConfirmDialog(String message, 
			Context ctx, OnClickListener listener){
		//Create a builder
		AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
		builder.setTitle("Confirm");
		//add buttons and listener
		builder.setPositiveButton("OK", listener);
		builder.setNegativeButton("Cancel", listener);
		//set message
		builder.setMessage(message);
		//Create the dialog
		AlertDialog ad = builder.create();
		//show
		ad.show();
	}
}
